package base.java8;

/**
 * lambda表达式本质上是一段匿名内部类,也可以是一段可以传递的代码
 *
 * @author 王霄
 * @date 2021/9/28 21:24
 */
public class LambdaDemo {
    public static void main(String[] args) {
        Runnable runnable = () -> System.out.println("runnable运行");
        runnable.run();

        LService service = () -> "接口调用成功";
        System.out.println(service.get());
    }

    @FunctionalInterface
    public interface LService {
        String get();
    }
}
